package com.jusyl.cristo.rpc;

import java.net.MalformedURLException;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.caucho.hessian.client.HessianProxyFactory;
import com.jusyl.cristo.rpc.hessian.HessianServiceTest;

@Controller
@RequestMapping("/rpc")
public class RpcCall {
	
	@RequestMapping("/hessian")
	public void hessian() throws MalformedURLException {
		HessianProxyFactory factory = new HessianProxyFactory();
        String url = "http://localhost:8081/cristo/hessian";
        HessianServiceTest hst = (HessianServiceTest) factory.create(HessianServiceTest.class, url);
        hst.sayGoodBye("马上发");
	}
	
	
	@RequestMapping("/dubbo")
	public void ldubbo() throws MalformedURLException {
		HessianProxyFactory factory = new HessianProxyFactory();
        String url = "http://localhost:8081/cristo/hessian";
        HessianServiceTest hst = (HessianServiceTest) factory.create(HessianServiceTest.class, url);
        hst.sayGoodBye("马上发");
	}
}
